angular.module('starter')
    .controller('mycollectionCtrl', function($scope, $ionicScrollDelegate, $state, $stateParams, meilvFac) {
        $scope.collection=[];
        $scope.myCollection = function() {
            meilvFac.collection.collectionget(
                function(data) {
                    $scope.oneday = data.info;
                },
                function(data) {
                    alert(data.info);
                }
            )
        }
        $scope.initDetail = function(i) {
            meilvFac.articleshow.index({ article_id: i },
                function(data) {
                    $scope.collection.push(data.info[0].collection);
                },
                function(data) {
                    alert(data.data.info);
                }
            );
        }

         $scope.userCollection = function(id) {
            meilvFac.collection.collectionadd({ article_id: id },
                function(data) {
                    $scope.myCollection();
                },
                function(data) {
                    alert(data.data.info);
                }
            )
        }
    })
